﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SlideShowGenerator.Window1"
    Title="SlideShowGenerator" Height="604" Width="757" xmlns:d="http://schemas.microsoft.com/expression/blend/2006" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" 
    xmlns:SlideShowGenerator_Data="clr-namespace:SlideShowGenerator.Data" MinWidth="750" MinHeight="400" >
	<Window.Resources>
		<ObjectDataProvider x:Key="AlbumDataDS" d:IsDataSource="True" ObjectType="{x:Type SlideShowGenerator_Data:AlbumData}"/>
		<DataTemplate x:Key="AlbumDataTemplate">
           <Grid>
           <Rectangle Margin="1" RadiusX="21" RadiusY="21">
           	<Rectangle.Fill>
           		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
           			<GradientStop Color="#FF88888A" Offset="0"/>
           			<GradientStop Color="#FF2E2E2E" Offset="0.987"/>
           			<GradientStop Color="#FF8186FF" Offset="0.44"/>
           			<GradientStop Color="#FFB7B9FF" Offset="0.68"/>
           		</LinearGradientBrush>
           	</Rectangle.Fill>
           </Rectangle>
           <StackPanel Margin="8,8,8,8">                
                <StackPanel Orientation="Horizontal">
                    <TextBlock FontSize="16">Album:</TextBlock>
                    <TextBlock FontSize="16" Text="{Binding Path=Title}" />  
                </StackPanel>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                    <Image Source="{Binding Path=ThumbImagePath}"  Width="100" Height="100"/>
                        <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Vertical">
                            <TextBlock Width="100">Title</TextBlock>
                            <TextBox Width="100" Text="{Binding Path=Title}" TextWrapping="Wrap" />
                        </StackPanel>
                        <StackPanel Orientation="Vertical">
                            <TextBlock Width="200">Description</TextBlock>
                            <TextBox Width="200" Text="{Binding Path=Description}" TextWrapping="Wrap" />
                        </StackPanel>
                        <StackPanel Orientation="Vertical">
                                <CheckBox IsChecked="{Binding Path=EnableGeneration}">Add to SlideShow</CheckBox>
                        </StackPanel>
                        </StackPanel>
                </StackPanel>
                <ItemsControl ItemsSource="{Binding Path=Images, Mode=OneWay}">
				<ItemsControl.ItemTemplate>
						<DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding Path=ThumbFile}" Tag="{Binding Path=ThumbFile}" 
                                           Width="100" Height="100">
                                        <Image.ToolTip>
                                            <Image Source="{Binding Path=ImageFile}" Width="400" />
                                        </Image.ToolTip>
                                    </Image>
                                    <StackPanel Orientation="Horizontal">
                                        <StackPanel Orientation="Vertical">
                                            <TextBlock Width="100" >Title</TextBlock>
                                            <TextBox Width="100" Text="{Binding Path=Title}" TextWrapping="Wrap"/>
                                        </StackPanel>
                                        <StackPanel Orientation="Vertical">
                                            <TextBlock Width="100" >Author</TextBlock>
                                            <TextBox Width="100" Text="{Binding Path=Author}" TextWrapping="Wrap" />
                                        </StackPanel>
                                        <StackPanel Orientation="Vertical">
                                            <TextBlock Width="200" >Description</TextBlock>
                                            <TextBox Width="200" Text="{Binding Path=Comment}" TextWrapping="Wrap" />
                                        </StackPanel>
                                        <StackPanel Orientation="Vertical">
                                            <TextBlock Width="100" >Date Taken</TextBlock>
                                            <TextBox Width="100" Text="{Binding Path=DateTaken}" TextWrapping="Wrap" />
                                        </StackPanel>
                                        <StackPanel Orientation="Vertical">
                                            <CheckBox IsChecked="{Binding Path=EnableGeneration}">Add to Album</CheckBox>
                                            <Button Tag="{Binding Path=Album}" ToolTip="{Binding Path=ThumbFile}" Click="Button_Click">Album Thumbnail</Button>
                                        </StackPanel>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
					</ItemsControl.ItemTemplate>
				</ItemsControl>
			</StackPanel>
            </Grid>
		</DataTemplate>
		<Storyboard x:Key="anBusy">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="stsBusy" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="360"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Window.Resources>
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
	</Window.Triggers>
    <Grid>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="47.908"/>
    		<RowDefinition Height="421.98*"/>
    		<RowDefinition Height="96.112"/>
    	</Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Width="85" Height="75.908" Grid.RowSpan="2" VerticalAlignment="Top"></StackPanel>
        <ScrollViewer Background="AliceBlue" Margin="0,37,0,0" Grid.Row="1">
            <ItemsControl VirtualizingStackPanel.IsVirtualizing="True" Name="lstAlbums" Margin="0,0,0,0" 
                 ItemsSource="{Binding Mode=OneWay, Source={StaticResource AlbumDataDS}}" 
                 ItemTemplate="{DynamicResource AlbumDataTemplate}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
        </ScrollViewer>
        <Ellipse HorizontalAlignment="Right" Width="76" x:Name="stsBusy" RenderTransformOrigin="0.5,0.5" Height="76" Grid.RowSpan="2" VerticalAlignment="Top" Margin="0,1,5,0">
        	<Ellipse.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1" ScaleY="1"/>
        			<SkewTransform AngleX="0" AngleY="0"/>
        			<RotateTransform Angle="0"/>
        			<TranslateTransform X="0" Y="0"/>
        		</TransformGroup>
        	</Ellipse.RenderTransform>
        	<Ellipse.Fill>
        		<RadialGradientBrush>
        			<RadialGradientBrush.RelativeTransform>
        				<TransformGroup>
        					<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.304" ScaleY="1.823"/>
        					<SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
        					<RotateTransform Angle="0" CenterX="0.5" CenterY="0.5"/>
        					<TranslateTransform X="0.166" Y="-0.426"/>
        				</TransformGroup>
        			</RadialGradientBrush.RelativeTransform>
        			<GradientStop Color="#FF0E4ED8" Offset="0"/>
        			<GradientStop Color="#FFFFFFFF" Offset="1"/>
        		</RadialGradientBrush>
        	</Ellipse.Fill>
        </Ellipse>
        <ListView x:Name="lstMessages" Margin="0,10.728,236,0" Grid.Row="2" />
        <Button Grid.Row="2" HorizontalAlignment="Right" Margin="0,0,8,10" Name="btnExit" Width="103" Click="btnExit_Click" Height="29" VerticalAlignment="Bottom">Exit</Button>
        <Button HorizontalAlignment="Right" Margin="0,9,87,0" Name="btnSelectImageDir" Width="55" Click="btnSelectImageDir_Click" Height="28.888" VerticalAlignment="Top">Browse</Button>
        <Button HorizontalAlignment="Right" IsEnabled="True" Margin="0,2.02,87,0" Name="btnSelectOutDir" Width="55" Height="28" Grid.Row="1" VerticalAlignment="Top" Click="btnSelectOutDir_Click">Browse</Button>
        <Button Margin="0,10.728,122,0" x:Name="btnGenOutImages" Click="btnGenOutImages_Click" Content="Generate Images" IsEnabled="False" Height="27" Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Right" Width="103" />
        <Button Margin="0,10.728,8,0" x:Name="btnGenData" Click="btnGenData_Click" HorizontalAlignment="Right" Width="103" Height="27" IsEnabled="False" Grid.Row="2" VerticalAlignment="Top">Generate Data</Button>
        <Button Height="29" Name="button1" Width="103" Click="button1_Click" HorizontalAlignment="Right" Margin="0,0,122,10" VerticalAlignment="Bottom" Grid.Row="2">Options</Button>
        <Label HorizontalAlignment="Left" Margin="8,9.888,0,0" Name="label1" Width="101" Height="28" VerticalAlignment="Top">Input Directory</Label>
        <Label HorizontalAlignment="Left" Margin="8,2.02,0,0" Name="label2" Width="101" Height="28" Grid.Row="1" VerticalAlignment="Top">Output Directory</Label>
        <TextBox Margin="113,11.888,156,11.112" Name="txtInputDir" IsReadOnly="True" />
        <TextBox Margin="113,7.132,156,0" Name="txtOutputDir" Height="22.888" Grid.Row="1" VerticalAlignment="Top" IsReadOnly="True" />
    </Grid>
</Window>
